import React, {Component} from 'react'
import {connect} from 'react-redux'
import DetailList from './components/details/detailList'
import {push} from 'react-router-redux/lib/actions'
import {injectIntl} from 'react-intl'
import {detailGet} from './actions'
import Nav from 'app/shared/layouts/nav'
import {routerShape} from 'react-router'

@injectIntl
@connect(state => {
  return {
    question: state.detailList.question,
    answerIds: state.detailList.answerIds,
    answers: state.detailList.answers
  }
}, {
  detailGet,
  push
})
export default class Detail extends Component {
  static contextTypes = {
    router: routerShape.isRequired
  }
  render() {
    return (
      <div>
        <Nav />
        <DetailList {...this.props} />
      </div>
    )
  }
}
